<template>
    <div>
        <li @click="onclick(video.playUrl)">
          <div class="fliex">
              <img :src="video.userPic" alt="">
            <div class="title">
              <h4>{{video.userName}}</h4>
              <p>{{video.title}}</p>
            </div>
          </div>
          <div class="videos">
            <img :src="video.coverUrl" alt="">
            <van-icon class="icon" name="play-circle-o" />
          </div>
        </li>
    </div>
</template>

<script>
    export default {
        name: "video-main",
        data(){
            return{
            }
        },
        props:{
            video:[Array,Object],
        },
        created() {
        },
      methods:{
          onclick(url){
            this.$router.push({path:'/videoDetail',query:{url:url}})
          }
      }
    }
</script>

<style scoped lang="less">
*{
  margin: 0;
  padding: 0;
}
.fliex{
  display: flex;
  padding: 0 5px;
  box-sizing: border-box;
  justify-content: space-between;
  margin-bottom: 2px;
  border-radius: 10px 10px 0 0 ;
  background-color: white;
  >img{
    margin-top: 12px;
    width: 40px;
    height: 40px;
    margin-top: 12px;
    border-radius: 50px;
    overflow: hidden;
    flex-shrink: 0;
  }
  >div{
    width: 100%;
    padding-left: 20px;
  }
}
li{
  list-style: none;
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 30px;
  background-color: #f4f4f4;
  .videos{
    font-size: 0;
    position: relative;
    width: 100%;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    margin-top: -2px;
    >img{
      width: 100%;
    }
    >.icon{
      font-size: 50px;
      color: white;
      position: absolute;
      top: 44%;
      left: 44%;
    }
  }
}
.title{
  >h4{
    padding: 10px 0 0;
  }
  >p{
    padding: 5px 0;
  }
}

</style>